package util;

import java.io.IOException;
import java.util.Properties;

import org.springframework.core.io.support.PropertiesLoaderUtils;

public class PropertieUtil {
	public static String loadPropertie(String name) throws Exception{
		Properties props = PropertiesLoaderUtils.loadAllProperties("info.properties"); 
		return props.getProperty(name);
	}
	
	public static String loadLangPropertie(String lang, String key){
		Properties props = null;
		if(lang == null || "".equals(lang)){
			lang = "cn";
		}
		try {
			props = PropertiesLoaderUtils.loadAllProperties("lang/"+lang+".properties");
		} catch (IOException e) {
			e.printStackTrace();
			return "";
		} 
		return props.getProperty(key, "");
	}

}
